1. Copyright Notice
This patent document contains information subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent, as it appears in the U.S. Patent and Trademark Office files or records, but otherwise reserves all copyright rights whatsoever.
2. Field of the Invention
Aspects of the present invention generally relate to the field of machine vision manufacturing and inspection. More particularly, aspects of the present invention relate to a system and method for compressing grayscale pixel images of defects in manufactured products in a machine vision system.
3. Description of Background Information
The speed at which a visual inspection system, such as a machine vision system, can perform an inspection task is highly dependent on the complexity of the image data that must be processed, and the number of image features that must be extracted from the image data for comparison purposes in order to achieve a reliable decision on whether the product under inspection should be accepted or rejected. Image compression is used to reduce the a mount of space needed to store and time to transmit an image. Typically, the greater the amount of compression of an image, the greater the divergence between the original image and the image that would be restructured from the compressed data.
Compression of images is commonly achieved by various techniques of run-length encoding (RLE), in which adjacent pixels with identical or similar intensity values are represented by a single intensity value, and a count of the number of pixels within the run. The strings of identical bits are stored in a memory as a code to reduce the number of bits in memory.
There is a need for an efficient and effective data compression technique of image data associated with systems for inspecting, while retaining sufficient information about objects or defects in the image to enable a human viewer to identify the object""s characteristics.
The present invention, in one aspect, provides a system and method for compressing a grayscale image of an object against a background. In the illustrated embodiment, a lossy compression technique may be employed in a machine vision system. The distinction between object and background pixels is used to selectively and significantly compress image data, while retaining sufficient information about an object in the image to enable a human viewer to identify characteristics of the object. A maximum number of pixels for a run length for a pixel grouping is provided based upon whether the pixels are background or object pixels. Each compressed image is composed of fixed information, which includes a count of the initial background pixels and a count of the total number of encoded runs, and a variable number of encoded runs. The encoded runs include background encoding to produce background pixel runs, and object encoding to produce separate runs of object pixels. The object encoding generates runs of pixels that fall within respective ranges, and each run is defined as a function of the intensity value of the first pixel of a given run. The object and background runs are stored in a predetermined bit pattern as a compressed image.